// 封装购物车相关接口
import request from '@/utils/request'

export const addCartService = (goodId) =>{
    return request({
        url: '/user/shoppingCart/add',
        method: 'POST',
        data: {
            goodId
        }
    })
}

export const findCartListService = () =>{
    return request({
        url: '/user/shoppingCart/list',
        method: 'GET'
    })
}

export const updateCartService = (data) =>{
    return request({
        url: '/user/shoppingCart/update',
        method: 'PUT',
        data
    })
}

export const delCartService = (goodId) =>{
    return request({
        url: '/user/shoppingCart/delete',
        method: 'DELETE',
        data:{
            goodId
        }
    })
}